package com.bluno.engine;

import java.util.LinkedList;


public class Player {
	private LinkedList<Card> hand;
	private int id;
	private String name;
	private String address;
	private boolean online;
	private boolean turn;
	
	public Player()
	{
		hand = new LinkedList<Card>();
	}
	
	public void putCardOnHand(Card card)
	{
		this.hand.add(card);
	}
	public void throwCard(Card card)
	{
		this.hand.remove(card);
	}
	/**
	 * Remove usando o id da carta, usado para remover
	 * cartas dos inimigos
	 * @param cardId
	 */
	public void throwCard(String cardId)
	{
		for(int i = 0; i < hand.size(); ++i)
		{
			if(hand.get(i).getId().equals(cardId))
			{

				this.hand.remove(i);
				return;
			}
		}
	}
	public void showHand()
	{
		for(Card card: hand)
		{
			System.out.print(card.getId());
		}
	}
	public LinkedList<Card> getHand() {
		return hand;
	}
	
	public void setHand(LinkedList<Card> hand) {
		this.hand = hand;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public boolean isOnline() {
		return online;
	}
	public void setOnline(boolean online) {
		this.online = online;
	}
	public boolean isTurn() {
		return turn;
	}
	public void setTurn(boolean turn) {
		this.turn = turn;
	}

	public int getNCardsOnHand() {
		return this.hand.size();
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
	
	
}
